package com.javen.springbootneo4j.controller;

import com.javen.springbootneo4j.entity.node.City;
import com.javen.springbootneo4j.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: com.javen.springbootneo4j.controller
 * @Author: tujw@netinnet.cn
 * @Date: 2024/2/28 14:16
 */
@RestController
@RequestMapping("/city")
public class CityController {

    @Autowired
    private CityService cityService;

    @PostMapping("/save")
    public void saveCity(City city) {
        cityService.saveCity(city);
    }

    @GetMapping("/getPerson")
    public City findCity(City city) {
        return cityService.getCity(city);
    }

    @PostMapping("/updateById")
    public void updateById(Long id) {
        cityService.updateById(id);
    }

    @PostMapping("/deleteById")
    public void deleteById(Long id) {
        cityService.deleteById(id);
    }

}
